extArray = new Array(".rar");
function LimitAttach(form, file) {
allowSubmit = false;
if (!file) return;
while (file.indexOf("\\") != -1)
file = file.slice(file.indexOf("\\") + 1);
ext = file.slice(file.indexOf(".")).toLowerCase();
for (var i = 0; i < extArray.length; i++) {
if (extArray[i] == ext) { allowSubmit = true; break; }
}
if (allowSubmit) form.submit();
else
	alert("对不起，只能上传压缩格式的文件:  " 
			+ (extArray.join("  ")) + "\n请重新选择符合条件的文件"
			+ "再上传.");
			return(false);}